package com.czl.module_work.adapter

import com.blankj.utilcode.util.TimeUtils
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseDataBindingHolder
import com.czl.base.data.bean.ApplyBean
import com.czl.base.util.FormUtils
import com.czl.module_work.R
import com.czl.module_work.databinding.WorkItemAppointmentRecordBinding


/**
 * 创建日期：2022/1/5  21:02
 * 类说明:
 * @author：86152
 */
class AppointmentRecordAdapter :
    BaseQuickAdapter<ApplyBean.Data, BaseDataBindingHolder<WorkItemAppointmentRecordBinding>>(R.layout.work_item_appointment_record) {
    override fun convert(
        holder: BaseDataBindingHolder<WorkItemAppointmentRecordBinding>,
        item: ApplyBean.Data
    ) {
        holder.dataBinding.apply {
            this?.item = item
            this?.title = if (item.guestType == "2") {
                "访客邀约"
            } else {
                "访客预约"
            }

            this?.type = if (item.guestType == "2") {
                "邀"
            } else {
                "预"
            }

            this?.time = "提交时间："+ FormUtils.dealDateFormat(item.createTime)
        }
    }

}